package com.zheng.study.company.service;

import com.zheng.study.base.bean.Result;
import com.zheng.study.base.service.BaseService;
import com.zheng.study.company.entity.Admin;
import com.zheng.study.company.entity.Company;
import com.zheng.study.company.entity.User;

import javax.servlet.http.HttpServletResponse;

/**
 * newFile
 * ============================================================================
 * author : dzw
 * createDate:  2018/8/20 。
 * ============================================================================
 */
public interface UserService extends BaseService<User, String> {

	/**
	 * 根据adminId获取user
	 */
	User getUserByAdminId(String adminId);

	/**
	 * 关联账户（微信）验证用户名和密码，通过Shiro来实现的Login
	 */
	Result linkUser(HttpServletResponse httpServletResponse, Admin admin, String openId);

	/**
	 * 通过username获得openId
	 */
	String getOpenId(String name);

	/**
	 * 创建用户
	 */
	User createUser(String name, String adminId);

	/**
	 * 创建企业成员
	 */
	User createUser(String name, String adminId, Company company);

	/**
	 * 新建成员 user、admin
	 */
	Result createMember(String account, String password, String name, Company company);

	/**
	 * 获取用户的头像地址
	 */
	String getUserHeadUrl(User user);

}
